window.onload=function (){


    /**
     * 页面初始化
     * 事件绑定
     * */

    initErrBox();

   var btnLogin= document.getElementById('btnLogin');
   btnLogin.onclick = btnLoginClick;


function  btnLoginClick(){
    var username = document.getElementById('username').value;
    var password=document.getElementById('password').value;

    if(username==user.username&&password==user.password) {
        alert('登录成功');
    }else{
        var errBox=  document.getElementById('err');
        errBox.style.display='block';
        errBox.classList.add('danger');
    }

}
}

function initErrBox(){

   var errBox=  document.getElementById('err');
   errBox.style.display='none';

}